<me:UIEKP x:Class="WPFExcelReport.TEKYS"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls"
                     xmlns:Localization="clr-namespace:Localization;assembly=Localization" 
                    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN"  
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ZB="clr-namespace:WPFExcelReport;assembly=TVKZUAB"  
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"  
                    xmlns:WS="clr-namespace:WPFExcelReport;assembly=TWASTAMM"  
                    xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND" 
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIEKP.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:PreisConverter  x:Key="price"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
        <ucd:BYTE2TR x:Key="b2s"/>
        <ucd:Divideby10000 x:Key="dw"/>
    </me:UIEKP.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>
        <WrapPanel>
        <CheckBox Content="{Binding Source={Localization:Translate Word=供应商}}" IsChecked="{Binding IsShowLS,ElementName=TV}"/>
        </WrapPanel>
        <DataGrid Grid.Row="1"  Grid.Column="1"  
                  AutoGenerateColumns="False"  EnableRowVirtualization="False"  
                  Name="dlgMaster"  IsReadOnly="True"  
                  ItemsSource="{Binding Source={StaticResource vwMaster }}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True"
                  CanUserResizeRows="True"   
                  RowDetailsVisibilityMode="VisibleWhenSelected"   
                  EnableColumnVirtualization="True" 
                  HorizontalScrollBarVisibility="Auto" 
                  VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Path=EKPSA}" Header="{Binding Source={Localization:Translate Word=状态}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=EKPAUFKRS,Converter={StaticResource ResourceKey=pnum}}"  Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=EKPAUFLFD,Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=采购单号}}" Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=EKPAUFPOS,Converter={StaticResource ResourceKey=pnum}}"  Width="Auto"  />
                <DataGridTextColumn Binding="{Binding Path=PART}" Header="{Binding Source={Localization:Translate Word=面料}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=PFARBE}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"   />
                <DataGridTextColumn Binding="{Binding Path=EKPME1,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPME3,Converter={StaticResource d100}}" Header="{Binding Source={Localization:Translate Word=实收}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPTEXTKON,Converter={StaticResource gb2312}}" Header="{Binding Source={Localization:Translate Word=短/溢}}" Width="60" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPPRME,Converter={StaticResource d1000}}" Header="{Binding Source={Localization:Translate Word=价格}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=单位}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPWE1}" Header="{Binding Source={Localization:Translate Word=金额}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPMEEH}" Header="{Binding Source={Localization:Translate Word=单位}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPLTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="80" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPGENDAT1}" Header="{Binding Source={Localization:Translate Word=船样}}" Width="80" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPWUTERM}" Header="{Binding Source={Localization:Translate Word=确认}}" Width="80" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=EKPSACHB}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
            </DataGrid.Columns>
        </DataGrid>
        <WrapPanel Grid.Row="2" Grid.Column="1" IsEnabled="{Binding IsInactive,ElementName=TV,Converter={StaticResource not}}">
            <WrapPanel >
                <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TKEY2}"   Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM2,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TKEY3}"   Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding SUM3}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding TCOUNT1}"   Margin="10,0,0,0"></TextBlock>
                <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"></TextBlock>
            </WrapPanel>
            <TextBlock  Text="{Binding Source={Localization:Translate Word=更改}}"/>
            <TextBlock  Text="{Binding EKPAENB}"    Width="Auto"/>
            <TextBlock  Text="{Binding EKPAEND}"    Width="Auto"/>
            <TextBlock  Text="{Binding Source={Localization:Translate Word=创建}}"/>
            <TextBlock  Text="{Binding EKPNEUB}"    Width="Auto"/>
            <TextBlock  Text="{Binding EKPNEUD}"    Width="Auto"/>
        </WrapPanel>
    </Grid>
</me:UIEKP>
